package com.greydawn.AbstractFactoryPattern;

/**
 * @Author: zhongwr
 * @Create: 2021/12/6 22:53
 * @Version 1.0
 * @Description: 颜色工厂
 */
public class ColorFactory extends AbstractFactory{

    @Override
    Shape getShape(String name) {
        return null;
    }

    public Color getColor(String name) {
        if ("red".equalsIgnoreCase(name)) {
            return new Red();
        }
        if ("blue".equalsIgnoreCase(name)) {
            return new Blue();
        }
        return null;
    }
}
